PSPSDK=$(shell psp-config --pspsdk-path)
PSPLIBSDIR=$(PSPSDK)/..
PSPM33SDKDIR=$(PSPLIBSDIR)/m33-sdk

BUILD_PRX = 1
PSP_FW_VERSION=371

TARGET = PPA
OBJS = main.o player.o config.o skin.o ftfont.o cfgdialog.o versiondialog.o msgdialog.o skindialog.o videomode.o pspDveManager.o usbhost.o nethost.o NetHostFS.o\
	common/m33sdk.o common/framebuffer.o common/graphics.o common/imagefile.o common/fat.o common/directory.o common/MiniConv.o common/I18N.o common/ctrl.o common/base64.o common/mem64.o common/texture_subdivision.o \
	common/buffered_reader.o common/fgets_mod.o \
	mod/me_boot_start.o mod/audio_util.o \
	mod/audiodecoder.o mod/aspect_ratio.o \
	mod/codec_prx.o mod/mp4avcdecoder.o mod/avcdecoder.o mod/mp4vdecoder.o \
	mod/cpu_clock.o mod/mpegbase.o  \
	mod/pmp.o mod/pmp_decode.o mod/pmp_file.o mod/pmp_play.o mod/pmp_read.o  \
	mod/mkv.o mod/mkv_play.o mod/mkv_decode.o mod/mkv_read.o mod/mkv_file.o \
	mod/flv1.o mod/flv1_play.o mod/flv1_decode.o mod/flv1_read.o mod/flv1_file.o \
	mod/time_math.o mod/mp4.o mod/mp4_play.o mod/mp4_file.o mod/mp4_read.o mod/mp4_decode.o  \
	mod/movie_stat.o mod/movie_interface.o mod/gu_draw.o mod/gu_font.o \
	mod/psp1k_frame_buffer.o \
	mod/subtitle_parse.o mod/subtitle_microdvd.o mod/subtitle_subrip.o mod/subtitle_subass.o mod/subtitle_subssa.o \
	tinyxml/tinystr.o tinyxml/tinyxml.o tinyxml/tinyxmlerror.o tinyxml/tinyxmlparser.o \
	../cooleyesBridge/cooleyesBridge.o \

#OBJS += mod/flv1decoder.o

INCDIR = $(PSPM33SDKDIR)/include ../cooleyesBridge ../pspvideocodec ../libmpeg \
	../libmp4info.psp  ../libmkvinfo.psp ../libflv1info.psp \
	../opencore-amr.psp \

#INCDIR += ../ffmpeg-psp.0.5/include
INCDIR += ../libflv2mpeg4.psp
INCDIR += $(PSPLIBSDIR)/include $(PSPLIBSDIR)/include/freetype2

CFLAGS = -O3 -G0 -g -Wall -DENABLE_USBHOST -DENABLE_NETHOST
#CFLAGS = -O0 -G0 -g -Wall

#CFLAGS += -DUSE_FFMPEG_FLV1_DECODER
CFLAGS += -DUSE_FLV2MPEG4_CONV

CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)

USE_PSPSDK_LIBC =

LIBDIR = $(PSPM33SDKDIR)/lib .. $(PSPLIBSDIR)/lib \

#LIBDIR += ../ffmpeg-psp.0.5/lib

LDFLAGS =
LIBS = -lstdc++ -lpspkubridge \

#LIBS += -lavcodec -lavutil
LIBS += -lflv2mpeg4
LIBS += -lfreetype -lpng -lz -lm \
	-lpsppower -lpspaudiocodec -lpspaudio -lpspaudio_driver \
	-lpspgu -lpspmpeg -lpspjpeg -lpspvideocodec -lpspusb -lpspusbstor \
	-lpsphprm -lpsprtc -lmp4info -lmkvinfo -lflv1info -lbufferedio -lopencore-amrnb

EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = PMPlayer Advance
PSP_EBOOT_ICON = icon/icon.png
PSP_EBOOT_PIC1 = icon/bg3.png

PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak
#include build.mak
